<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>付款</title>
<link rel="stylesheet" type="text/css" href="../../layui/css/layui.css" media="all">
</head>
<body>
	<div class="layui-form-item">
		<br/>
		<label class="layui-form-label" style="font-size:19px;">应付款:</label>
		<span id="one"></span><span>元</span>
		<br/>
		<div class="layui-inline">
			<label class="layui-form-label" style="font-size:18px;">付款金额:</label>
			<div class="layui-input-inline">
				<input type="text" name="jinr" id="jinr" required
					lay-verify="required" placeholder="请输入金额" maxlength="11"
					autocomplete="off" class="layui-input" onMouseOut="yz(this.value)"
					style="width:160px;">
				<span id="ts" style="color:red;"></span>
			</div>
		</div>
		<div class="layui-input-block">
				<button class="layui-btn" data-type="getCheckData" id="add" onclick="show(this)">付款</button>
		</div>
	</div>
	<script src="../../layui/layui.js"></script>
	<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
	<script src="../../res/mln/getUrlParam.js"></script>
	<script type="text/javascript">
	    var jiage="";
		window.onload=function(){
			$.ajax({
	            url:"../../fdSell/jes.action",
	            data:{"arr":getUrlParam("arr")},
	            type: "post",
	            dataType:"json",
	            cache:false,
	            async: false,
	            success: function(tr){
	            	jiage=tr;
	            	 $("#one").append('<span style="font-size:28px;color:red;">&nbsp;&nbsp;&nbsp;&nbsp;'+tr+'&nbsp;&nbsp;</span>');
	            }
	         });
		}
		var st="";
		 function yz(obj){
			 var st = document.getElementById("ts");
			 if(obj<jiage){
				 st.innerHTML="您输入的金额还不能购买此商品";
			 }else{
				 st.innerHTML="";
			 }
			 st=st.innerHTML;
		}
		 
		 function show(obj){
			 var jinr=$("#jinr").val();
			 if(st==null || st==''){
				 $.ajax({
                     url:"../../fdSell/adds.action",
                     data:{"arr":getUrlParam("arr"),"jinr":jinr,"memberPhone":getUrlParam("memberPhone")},
                     type: "post",
                     dataType:"json",
                     cache:false,
                     async: false,
                     success: function(obj){
                    	//刷新页面
                    	 parent.parent.location.reload();
                     }
                  });
			 }
		 }
	</script>
</body>
</html>